#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;

using Real = double;

template<class Real, class T2>
std::vector<Real>& operator+=(std::vector<Real>& A, T2 const& v)
{
	Real _v = (Real)v;
	for (auto& a : A)
		a += _v;
	return A;
}

template<class string_type, class ST2>
void split(const string_type& str, const ST2& delim, std::vector<string_type>& ret)
{
	size_t i = 0;
	size_t j = 0;
	ret.clear();
	while ((j = str.find(delim, i)) != string_type::npos)
	{
		ret.push_back(str.substr(i, j - i));
		i = j + 1;
	}
	ret.push_back(str.substr(i));
}

template<class Real>
static void split_tie_beam(const std::string& str, std::vector<Real>& ret)
{
	std::vector<string> parts;
	std::vector<string> parts2;
	ret.clear();
	split(str, "+", parts);
	for (auto& p : parts)
	{
		split(p, "*", parts2);
		if (parts2.size() == 1)
			ret.push_back(std::stof(p));
		else {
			int n = std::stol(parts2[1]);
			Real v = std::stof(parts2[0]);
			for (int i = 0; i < n; ++i)
				ret.push_back(v);
		}
	}
}

template <class _InIt, class Real>
Real sum(const _InIt first, const _InIt last, Real v)
{
	_InIt f = first;
	for (; f != last; ++f)
		v += *f;
	return v;
}

int main()
{
	string src = "6.4+6.5*4+6.4";
	std::vector<Real> parts;
	split_tie_beam(src, parts);
	//parts += 4;
	auto s2 = std::accumulate(parts.begin(), parts.end(), 0.0);
	cout << parts.size() << " " << s2 << endl;
	for (auto& s : parts)
		cout << s << " ";
	cout << endl;
	return 0;
}